﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace RTS_RPG
{
    public class Battle_TextureManager
    {
        public static short BATTLE_CHARACTER_SIZE   = 32;
        public static short HALF_CHARACTER_SIZE     = 16;

        #region TEXTURE_SECTION
        /*********************/
        public Texture2D friendly_unit          { get; private set; }
        public Texture2D unit_default_image     { get; private set; }
        public Texture2D unit_default_attack    { get; private set; }
        public Texture2D unit_default_avatar    { get; private set; }
        public Texture2D keys_up                { get; private set; }
        public Texture2D keys_down              { get; private set; }
        public Texture2D keys_shift             { get; private set; }
        public Texture2D keys_ctrl              { get; private set; }
        public Texture2D keys_space             { get; private set; }
        public Texture2D HUD_background         { get; private set; }
        public Texture2D HUD_line               { get; private set; }
        public Texture2D HUD_friendlySelect     { get; private set; }
        public Texture2D HUD_enemySelect        { get; private set; }
        public Texture2D mouse                  { get; private set; }
        public Texture2D blankBoxSmall          { get; private set; }
        /*********************/
        #endregion
        public SpriteFont font;
        public SpriteFont font2;

        public IServiceProvider services;
        public ContentManager battle_textures;

        public Battle_TextureManager(IServiceProvider s)
        {
            services = s;
            font = null;
            font2 = null;

            friendly_unit       = null;

            unit_default_image  = null;
            unit_default_attack = null;
            unit_default_avatar = null;
            keys_up             = null;
            keys_down           = null;
            keys_shift          = null;
            keys_ctrl           = null;
            keys_space          = null;
            HUD_background      = null;
            HUD_line            = null;
            HUD_friendlySelect  = null;
            HUD_enemySelect     = null;
            mouse               = null;
            blankBoxSmall       = null;
        }

        public void LoadContent()
        {
            battle_textures = new ContentManager(services);
            battle_textures.RootDirectory = "Content";
            font                    = battle_textures.Load<SpriteFont>("Shared/Fonts/font1");
            font2                   = battle_textures.Load<SpriteFont>("Shared/Fonts/font2");

            friendly_unit           = battle_textures.Load<Texture2D>("Battle/Battle_Sprite");

            mouse                   = battle_textures.Load<Texture2D>("Shared/Mouse");
            unit_default_avatar     = battle_textures.Load<Texture2D>("Shared/Basic_Avatar");

            unit_default_image      = battle_textures.Load<Texture2D>("Battle/Basic_Unit");
            blankBoxSmall           = battle_textures.Load<Texture2D>("Battle/Select");
            keys_up                 = battle_textures.Load<Texture2D>("Battle/Keys/UpKey");
            keys_down               = battle_textures.Load<Texture2D>("Battle/Keys/DownKey");
            keys_shift              = battle_textures.Load<Texture2D>("Battle/Keys/ShiftKey");
            keys_ctrl               = battle_textures.Load<Texture2D>("Battle/Keys/CtrlKey");
            keys_space              = battle_textures.Load<Texture2D>("Battle/Keys/SpaceKey");
            HUD_background          = battle_textures.Load<Texture2D>("Battle/HUD/HUDBack");
            HUD_line                = battle_textures.Load<Texture2D>("Battle/HUD/HUDBack2");
            HUD_friendlySelect      = battle_textures.Load<Texture2D>("Battle/Friendly_Select");
            HUD_enemySelect         = battle_textures.Load<Texture2D>("Battle/Enemy_Select");
            blankBoxSmall           = battle_textures.Load<Texture2D>("Battle/Select");
        }

        public void UnloadContent()
        {
            battle_textures.Unload();
        }
    }
}
